App.Api.factory('Api.Newnote', [function () {
			/**
* Tworzy nową notatkę, lista powiązanych użytkowników jest pusta, lista powiązanych notatek również jest pusta. Czas jest ustawiony automatycznie na serwerze. Liczba notatek ograniczona do 1000.
* @class newnote
*/
function newnote(){
	/**
	* newnote
	* @property oper
	* @private 
	*/
	var oper = 'newnote',

	/**
	*  użytkownik, którego rola to user, zostaje właścicielem
	* @property user 
	* @private 
	*/
	user ,

	/**
	*  hasło tego użytkownika
	* @property pass 
	* @private 
	*/
	pass ,

	/**
	*  temat
	* @property topic 
	* @private 
	*/
	topic ,

	/**
	*  skrót, streszczenie
	* @property summary 
	* @private 
	*/
	summary ,

	/**
	*  klucze
	* @property keys 
	* @private 
	*/
	keys ,

	/**
	*  pełny tekst
	* @property text 
	* @private 
	*/
	text ,

	/**
	*  pełny tekst
	* @property text 
	* @private 
	*/
	text ,
	los,
	that = this;


	function getOper(noper){
		return oper;
	}
	function getUser(nuser){
		return user ;
	}
	function getPass(npass){
		return pass ;
	}
	function getTopic(ntopic){
		return topic ;
	}
	function getSummary(nsummary){
		return summary ;
	}
	function getKeys(nkeys){
		return keys ;
	}
	function getText(ntext){
		return text ;
	}
	function setUser(nuser){
		user  = nuser ;
	}
	function setPass(npass){
		pass  = npass ;
	}
	function setTopic(ntopic){
		topic  = ntopic ;
	}
	function setSummary(nsummary){
		summary  = nsummary ;
	}
	function setKeys(nkeys){
		keys  = nkeys ;
	}
	function setText(ntext){
		text  = ntext ;
	}
	function setLos (nLos) {
		los = nLos;
	}
	function toObject(){
		return{
			oper: oper,
			user : user ,
			pass : pass ,
			topic : topic ,
			summary : summary ,
			keys : keys ,
			text : text,
			los: los
		};
	}

	/**
 	* konstruktor
 	*
   	* @constructor         
  	* @method construct    
  	* @public              
 	*/
	(function newnote(){
		that.getOper = getOper;
		that.getUser = getUser;
		that.getPass = getPass;
		that.getTopic = getTopic;
		that.getSummary = getSummary;
		that.getKeys = getKeys;
		that.getText = getText;
		that.setUser = setUser;
		that.setPass = setPass;
		that.setTopic = setTopic;
		that.setSummary = setSummary;
		that.setKeys = setKeys;
		that.setText = setText;
		that.toObject = toObject;
		that.setLos = setLos;
	})();
}


newnote.fromObject = function (obj){
		var object = new newnote();
		object.setUser(obj.user);
		object.setPass(obj.pass);
		object.setTopic(obj.topic);
		object.setSummary(obj.summary);
		object.setKeys(obj.topic);
		object.setText(obj.text);
		object.setLos(new Date().getMilliseconds());
		return object;
	}

			return newnote;
		}]);